/**
 * @author caesar
 * @date 2025/7/2
 * @apiNote
 */

//输出矩阵
/*
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3    */
public class twoArrayPractice_1 {
    public static void main(String[] args) {
        //方法一，直接静态定义
        int[][] arr = {{1, 1, 1, 1, 1}, {2, 2, 2, 2, 2}, {3, 3, 3, 3, 3}};
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
        //方法二，动态定义
        int[][] arr1 = new int[3][5];

        for(int i = 0;i<arr1.length;i++){
            for(int j =0;j<arr[i].length;j++){
                arr1[i][j] = i+1;
                System.out.print(arr1[i][j]+" ");
            }
            System.out.println();
        }
    }
}
